package design.pattern.structural.facade;

public class GeneralSwitchFacade {

    private Fan fan;
    private Light[] lights;
    private AirConditioner airConditioner;
    private Television television;

    public GeneralSwitchFacade(Fan fan, Light[] lights, AirConditioner airConditioner, Television television) {
        this.fan = fan;
        this.lights = lights;
        this.airConditioner = airConditioner;
        this.television = television;
    }

    public void on() {
        this.fan.on();
        this.airConditioner.on();
        this.television.on();
        for (Light light : this.lights) {
            light.on();
        }
    }

    public void off() {
        this.fan.off();
        this.airConditioner.off();
        this.television.off();
        for (Light light : this.lights) {
            light.off();
        }
    }
}
